import os
import yaml
basepath = os.path.dirname(os.path.dirname(__file__))#获取文件路径
def read_yaml(file_path):
    print(basepath)
    with open(basepath + '/' +file_path,'r',encoding='utf-8') as f:#读取文件
        data = yaml.safe_load(f)
        if data is None:
            return 'yaml文件读取错误'
        else:
            return data